/**
 * author      : dormi330
 * date        : 2018/6/26
 * project     : mybatis
 * description : TODO
 */

package org.wzq.learn.utils;

import java.util.UUID;

public class CommonUtils {

    // 获取uuid, 目前采用java自带的uuid
    public static String uuid() {
        return UUID.randomUUID().toString().substring(0, 32);
    }

    public static String currentClassAndMethod() {
        final StackTraceElement e = Thread.currentThread().getStackTrace()[2];
        final String s = e.getClassName();
        return s.substring(s.lastIndexOf('.') + 1, s.length()) + "." + e.getMethodName();
    }
}
